#define _CRT_SECURE_NO_WARNINGS 1
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
vector<string> result;
string s;
string path;
vector<bool> used;
void backtrack()
{
    if (path.size() == s.size())
    {
        result.push_back(path);
        return;
    }
    for (int i = 0; i < s.size(); ++i)
    {
        if (used[i]) continue;
        else
        {
            path.push_back(s[i]);
            used[i] = true;
            backtrack();
            path.pop_back();
            used[i] = false;
        }
    }
}
vector<string>permute(string s)
{
    string str = s;
    used.resize(s.size(), false);
    backtrack();
    return result;
}
/*
int main()
{
    string input;
    cin >> input;
    vector<string> res = permute(input);
    for (const string& perm : res)
    {
        cout << perm << endl;
    }
    return 0;
}*/